/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package adelito;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 *
 * @author mdneto
 */
public class Main {
    public Main(){
        this.escrita();
    }
    
    public void escrita() {
           try {
               System.out.println("Digite o texto");
               FileOutputStream f0 = new FileOutputStream("C:\\exemplo1.txt");
               byte a = (byte) System.in.read();
               while (a != '\n'){
                     f0.write(a);
                     a = (byte)System.in.read();
               }
           } catch (IOException e){
                       System.out.println("erro"+e.getMessage());
           } catch (Exception e){
                       System.out.println("erro");
           }
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
          new Main();
          new Exemplo2();
    }
}
